package com.kanqiubao.kq.fragment;
import java.util.List;

public abstract class BaseRefreshFragment<T> extends BaseFragment<List<T>> {
	protected int pageIndex = 1;
	protected int pageSize = 20;
	protected boolean isRefresh = true;

	/**
	 * 0表示url前面没有字符串，其他表示有字符串
	 * 
	 * @param type
	 * @return
	 */
	protected String getCurrentPage(int type) {
		if (type != 0) {
			return "&size=" + pageSize + "&page=" + pageIndex;
		} else {
			return "?size=" + pageSize + "&page=" + pageIndex;
		}
	}

	@Override
	protected void requestData() {
		if (isRefresh) {
			if (mEmptyLayout != null) {
				isVisableView(3);
			}
		} else {
			super.requestData();
		}
	}
}
